<template>
	<view>
		<view class="success-box">
			<image src="../../static/currentZHY/success.png" mode="widthFix"></image>
			<text class="success">购买成功</text>
			<text class="date">将于<text>{{currentDate}}</text>开始计算收益</text>
		</view>
		
		<view class="btn-box">
			<button @tap="toCurrent">再去逛逛</button>
			<button >查看我的资产</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		computed: {
			// 数据里没有收益日期,自己获取当前时间
			currentDate() {
				const date = new Date();
				const year = date.getFullYear();
				const mouth = date.getMonth() + 1;
				const day = date.getDate()
				return year + '年' + mouth + '月' + day + '日'
			}
		},
		methods: {
			toCurrent(){
				uni.navigateTo({
				    url: '/pages/currentZHY/currentZHY'
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.success-box {
		width: 520rpx;
		margin: 0 auto;
		margin-top: 220rpx;
		display: flex;
		flex-direction: column;
		align-items: center;

		image {
			width: 120rpx;
		}

		.success {
			display: block;
			margin-top: 36rpx;
			margin-bottom: 24rpx;
			font-weight: bold;
		}

		.date {
			display: block;
			color: #333333;
			font-size: 28rpx;
			text{
				color: #007AFF;
			}
		}
	}
	.btn-box{
		display: flex;
		justify-content: center;
		margin-top: 100rpx;
		button{
			width: 300rpx;
			margin: 0;
			line-height: 80rpx;
			font-size: 28rpx;
			&:first-child{
				background-color: #FFFFFF;
			}
			&:last-child{
				background-color: #FFFFFF;
				margin-left: 24rpx;
				color: #007AFF;
				border: 2rpx solid #007AFF;
			}
		}
	}
</style>
